Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posix: fs: refactor posix_file_system_r #83395

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Dec 26, 2024

  • tests: posix: fs: increase ztest stack size from 1k to 2k

  • correct arguments to readdir_r() in tests/posix/fs/src/test_fs_dir.c

  • move struct posix_fs_desc to fs_priv.h

  • move POSIX_FILE_SYSTEM_R code to file_system_r.c and separate Kconfig

Previously, a NULL pointer was passed as the second argument to
readdir_r(). This is incorrect. The passed pointer should be
to a valid, externally-allocated struct direct.

Signed-off-by: Chris Friedt <[email protected]>
Move struct posix_fs_desc to fs_priv.h

Signed-off-by: Chris Friedt <[email protected]>
@cfriedt cfriedt force-pushed the fix-readdir-r branch 3 times, most recently from db11023 to a104447 Compare December 26, 2024 10:47
@cfriedt cfriedt requested a review from ycsin December 26, 2024 10:50
@cfriedt cfriedt marked this pull request as ready for review December 26, 2024 10:51
@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Dec 26, 2024
@cfriedt cfriedt changed the title tests: posix: fs: correct arguments to readdir_r() posix: fs: refactor posix_file_system_r Dec 26, 2024
@cfriedt cfriedt marked this pull request as draft December 26, 2024 13:13
@cfriedt cfriedt force-pushed the fix-readdir-r branch 2 times, most recently from 7dbd1fb to 05cdff0 Compare December 26, 2024 14:54
@cfriedt cfriedt marked this pull request as ready for review December 26, 2024 14:55
@cfriedt cfriedt requested a review from de-nordic December 26, 2024 14:56
@cfriedt cfriedt added the area: Tests Issues related to a particular existing or missing test label Dec 26, 2024
Copy link
Member

@ycsin ycsin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@nandojve nandojve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small fix to match the commit message.

tests/posix/fs/prj.conf Show resolved Hide resolved
The default stack size was causing qemu_arc/qemu_arc_em and
qemu_arc/qemu_arc_hs to fail when a dirent object was
stack-allocated.

Increase the default stack size to accomodate for additional
usage.

Signed-off-by: Chris Friedt <[email protected]>
Move the functionality of POSIX_FILE_SYSTEM_R to its own
compilation unit and remove the unnecessary dependency on
POSIX_FILE_SYSTEM.

Signed-off-by: Chris Friedt <[email protected]>
@kartben kartben merged commit bc5aff3 into zephyrproject-rtos:main Jan 2, 2025
26 checks passed
@cfriedt cfriedt deleted the fix-readdir-r branch January 2, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: File System area: POSIX POSIX API Library area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants